package com.peter.nacos.springcloudnacosdemo.dubbo.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: 肖冬
 * @Date: 2020/8/28 20:06
 * @Description:
 */
@RefreshScope//spring中的注解，表示当前类的属性，需要动态刷新
@RestController
public class ConfigController {

    //info来自nacos配置中心
    @Value("${info:hello xiaodong}")
    private String info;

    @GetMapping("/get")
    public String info(){
        return info;
    }
}
